package com.qy.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigDecimal;

/**
 CREATE TABLE `promotion_policy` ( 
   `promotion_id` varchar(32) NOT NULL COMMENT '优惠唯一标识符', 
   `name` varchar(100) NOT NULL COMMENT '优惠名称', 
   `description` varchar(255) NOT NULL COMMENT '优惠描述', 
   `target_packages` text NOT NULL COMMENT '适用套餐列表（数组落地为逗号分隔）', 
   `discount_type` enum('percentage','fixed_amount') NOT NULL COMMENT '折扣类型', 
   `discount_value` decimal(10,2) NOT NULL COMMENT '折扣值', 
   `eligibility` text NOT NULL COMMENT '适用用户群体（数组落地为逗号分隔）', 
   `valid_period` varchar(100) NOT NULL COMMENT '有效期', 
   PRIMARY KEY (`promotion_id`), 
   KEY `idx_eligibility` (`eligibility`(100)), 
   KEY `idx_target_pkg` (`target_packages`(100)) 
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='优惠政策表';
 */
@Data
@TableName("promotion_policy")
public class PromotionPolicy {
    @TableId
    private String promotionId; // 优惠唯一标识符
    
    private String name; // 优惠名称
    private String description; // 优惠描述
    private String targetPackages; // 适用套餐列表（数组落地为逗号分隔）
    private String discountType; // 折扣类型
    private BigDecimal discountValue; // 折扣值
    private String eligibility; // 适用用户群体（数组落地为逗号分隔）
    private String validPeriod; // 有效期
}